home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
mad201.arc
/
MADIN200.ASC
< prev
next >
Wrap
Text File
|
1980-01-01
|
3KB
|
77 lines
100 ROW%=12 ' THIS IS ROW LOCATION
110 COL%=20 ' THIS IS COLUMN LOCATION
120 FLDSIZ%=6 ' SIZE OF INPUT FIELD
130 FLDFG%=9 ' FIELD MASK FOREGROUND COLOR
140 FLDBG%=9 ' FIELD MASK BACKGROUND COLOR
150 CURSFG%=20 ' CURSOR FOREGROUND COLOR
160 CURSBG%=6 ' CURSOR BACKGROUNG COLOR
170 CHRFG%=7 ' CHARACTERS TYPED FOREGROUND COLOR
180 CHRBG%=1 ' CHARACTERS TYPED BACKGROUND COLOR
190 FLDCHR%=249 ' ASCII CODE OF FIELD MASK CHARACTER
200 CURCHR%=254 ' ASCII CODE OF CURSOR CHARACTER
210 SYSFIL$="" ' VARIABLE TO HOLD USER SELECTABLE FILL CHARACTER
220 FILCHR$="" ' THIS IS THE FILL CHARACTER TO BE USED
230 SYSTYP%=2 ' SYSTYP%=1 IS A/N RIGHT, =2 IS NUMERIC, 3 IS A/N LEFT
250 '-------------------------------------------------------------------------
20000 SYSALPHA$=""
20010 LOCATE ROW%,COL%
20020 FOR X=1 TO FLDSIZ%
20030 COLOR FLDFG%,FLDBG%
20040 PRINT CHR$(FLDCHR%);
20050 NEXT X
20060 IF FLDSIZ%=LEN(SYSALPHA$) THEN GOTO 20110
20070 LOCATE ROW%,COL%
20080 COLOR CURSFG%,CURSBG%
20090 PRINT CHR$(CURCHR%);
20100 LOCATE ROW%,COL%
20110 STROKE$=INKEY$
20120 REM
20130 IF LEN(SYSALPHA$)<>FLDSIZ% THEN GOTO 20230
20140 LOCATE ROW%,COL%-1
20150 COLOR CHRFG%,CHRBG%
20160 PRINT RIGHT$(SYSALPHA$,1);
20170 FOR Y=1 TO 200:NEXT Y
20180 LOCATE ROW%,COL%-1
20190 COLOR CURSFG%,CURSBG%
20200 PRINT CHR$(CURCHR%);
20210 FOR Z=1 TO 200:NEXT Z
20220 REM
20230 IF STROKE$ = "" THEN GOTO 20110
20240 IF STROKE$ = CHR$(13) THEN GOTO 20390
20250 IF STROKE$ = CHR$(8) AND LEN(SYSALPHA$)=0 THEN GOTO 20110
20260 IF STROKE$ = CHR$(8) AND LEN(SYSALPHA$)=FLDSIZ% THEN LOCATE ROW%,COL%-1
20270 IF STROKE$ = CHR$(8) THEN COLOR FLDFG%,FLDBG%::PRINT CHR$(FLDCHR%);:COL%=COL%-1:SYSALPHA$=LEFT$(SYSALPHA$,LEN(SYSALPHA$)-1):GOTO 20060
20280 IF SYSTYP%=1 OR SYSTYP%=3 THEN GOTO 20310 'ALPHANUMERIC FIELD
20290 IF SYSTYP%=2 THEN GOTO 20320 'NUMERIC FIELD
20300 SYSTYP%=1 'DEFAULT TO ALPHA IF NOT SET TO 1 OR 2
20310 IF STROKE$ < CHR$(32) OR STROKE$ > CHR$(126) THEN GOTO 20110 ELSE GOTO 20330
20320 IF STROKE$ < CHR$(48) OR STROKE$ > CHR$(57) THEN GOTO 20110 ELSE GOTO 20330
20330 IF FLDSIZ%=LEN(SYSALPHA$) THEN GOTO 20110
20340 SYSALPHA$=SYSALPHA$+STROKE$
20350 COLOR CHRFG%,CHRBG%
20360 PRINT STROKE$;
20370 COL%=COL%+1
20380 GOTO 20060
20390 IF LEN(SYSALPHA$)<>FLDSIZ% THEN LOCATE ROW%,COL%:COLOR FLDFG%,FLDBG%:PRINT CHR$(FLDCHR%);:GOTO 20430
20400 LOCATE ROW%,COL%-1
20410 COLOR CHRFG%,CHRBG%
20420 PRINT RIGHT$(SYSALPHA$,1);
20430 IF SYSTYP%=1 THEN GOTO 20470 'ALPHA RIGHT
20440 IF SYSTYP%=2 THEN GOTO 20590 'NUMERIC
20450 IF SYSTYP%=3 THEN GOTO 20530 'ALPHA LEFT
20460 SYSTYP%=3:GOTO 20530 'DEFAULT TO ALPHA LEFT
20470 FOR X=1 TO FLDSIZ%
20480 LET SYSFIL$=SYSFIL$+FILCHR$
20490 NEXT X
20500 LET SYSFIL$=RIGHT$(SYSFIL$,FLDSIZ%)
20510 LET SYSALPHA$=SYSFIL$+SYSALPHA$
20520 LET SYSALPHA$=RIGHT$(SYSALPHA$,FLDSIZ%)
20530 FOR X=1 TO FLDSIZ%
20540 LET SYSFIL$=SYSFIL$+FILCHR$
20550 NEXT X
20560 LET SYSFIL$=RIGHT$(SYSFIL$,FLDSIZ%)
20570 LET SYSALPHA$=SYSALPHA$+SYSFIL$
20580 LET SYSALPHA$=LEFT$(SYSALPHA$,FLDSIZ%)
20590 IF SYSTYP%=2 THEN SYSNUM=VAL(SYSALPHA$)
20600 RETURN